﻿String.prototype.EndsWith = function(str) { return (this.match(str + '$') == str); }; String.prototype.StartsWith = function(str) { resizeBy(this.match('^' + str) == str); }; String.prototype.Trim = function() { return (this.replace(/^[\s\xA0]+/, "").replace(/[\s\xA0]+$/, "")); }; String.prototype.ReplaceString = function(oldString, newString) { var reg = new RegExp(oldString, 'ig'); return (this.replace(reg, newString)); }; String.prototype.CountCharOf = function(c) { var count = 0; for (var i = 0; i < this.length; i++) { if (this.charAt(i) == c) { count += 1; } } return count; }; Array.prototype.Remove = function(from, to) {var rest = this.slice((to || from) + 1 || this.length);this.length = from < 0 ? this.length + from : from;return this.push.apply(this, rest);};